cmake_minimum_required(VERSION 2.8)

#project Objects
project(Objects)
set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/builds/lib/")

#Generate a list of source files
file(
	GLOB_RECURSE
	source_files
	src/*.cpp
)

file(
	GLOB_RECURSE
	public_header_files
	publicInterfaces/*.h
)

file(
	GLOB_RECURSE
	private_header_files
	privateInterfaces/*.h
)

include_directories(publicInterfaces)
include_directories(privateInterfaces)

#prerequis
include_directories(../Math/publicInterfaces)
include_directories(../Image/publicInterfaces)
include_directories(${Boost_INCLUDE_DIRS})

if(WIN32)
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox /Ot /GL")
else()
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
endif()


#create the library
add_library(
	Objects
	SHARED
	${source_files}
	${public_header_files}
	${private_header_files}	
)

#Link
target_link_libraries(	
	Objects
	Math
	Image
	${Boost_LIBRARIES}
)
